from flask.blueprints import Blueprint
from toutiaoapi.flaskrestful import BaseApi

# 创建蓝图
home_blueprint = Blueprint('home', __name__, url_prefix='/app/v1_0')

# 创建api接管蓝图
home_api = BaseApi(home_blueprint)

# 定义类视图
from . import views

# 让api实例绑定类视图路由
home_api.add_resource(views.IndexResource, '/')

# 获取所有频道
home_api.add_resource(views.AllChannelResource,'/channels')

# 用户频道
home_api.add_resource(views.UserChannelResource, '/user/channels')